.class Lrexsee/service/RexseePushSmsListener$1;
.super Landroid/database/ContentObserver;
.source "RexseePushSmsListener.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lrexsee/service/RexseePushSmsListener;->register()V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lrexsee/service/RexseePushSmsListener;


# direct methods
.method constructor <init>(Lrexsee/service/RexseePushSmsListener;Landroid/os/Handler;)V
    .locals 0
    .param p2, "$anonymous0"    # Landroid/os/Handler;

    .prologue
    .line 1
    iput-object p1, p0, Lrexsee/service/RexseePushSmsListener$1;->this$0:Lrexsee/service/RexseePushSmsListener;

    .line 47
    invoke-direct {p0, p2}, Landroid/database/ContentObserver;-><init>(Landroid/os/Handler;)V

    return-void
.end method


# virtual methods
.method public onChange(Z)V
    .locals 10
    .param p1, "selfChange"    # Z

    .prologue
    .line 50
    invoke-super {p0, p1}, Landroid/database/ContentObserver;->onChange(Z)V

    .line 51
    invoke-virtual {p0}, Lrexsee/service/RexseePushSmsListener$1;->deliverSelfNotifications()Z

    move-result v1

    if-eqz v1, :cond_0

    .line 66
    :goto_0
    return-void

    .line 53
    :cond_0
    :try_start_0
    new-instance v1, Lrexsee/service/RexseePushSmsListener;

    iget-object v2, p0, Lrexsee/service/RexseePushSmsListener$1;->this$0:Lrexsee/service/RexseePushSmsListener;

    # getter for: Lrexsee/service/RexseePushSmsListener;->smsContext:Landroid/content/Context;
    invoke-static {v2}, Lrexsee/service/RexseePushSmsListener;->access$0(Lrexsee/service/RexseePushSmsListener;)Landroid/content/Context;

    move-result-object v2

    invoke-direct {v1, v2}, Lrexsee/service/RexseePushSmsListener;-><init>(Landroid/content/Context;)V

    # invokes: Lrexsee/service/RexseePushSmsListener;->getItems()[Ljava/lang/String;
    invoke-static {v1}, Lrexsee/service/RexseePushSmsListener;->access$1(Lrexsee/service/RexseePushSmsListener;)[Ljava/lang/String;

    move-result-object v9

    .line 54
    .local v9, "smsNumbers":[Ljava/lang/String;
    iget-object v1, p0, Lrexsee/service/RexseePushSmsListener$1;->this$0:Lrexsee/service/RexseePushSmsListener;

    # getter for: Lrexsee/service/RexseePushSmsListener;->smsContext:Landroid/content/Context;
    invoke-static {v1}, Lrexsee/service/RexseePushSmsListener;->access$0(Lrexsee/service/RexseePushSmsListener;)Landroid/content/Context;

    move-result-object v1

    invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    .line 55
    .local v0, "contentResolver":Landroid/content/ContentResolver;
    const-string v1, "content://sms/inbox"

    invoke-static {v1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v1

    const/4 v2, 0x7

    new-array v2, v2, [Ljava/lang/String;

    const/4 v3, 0x0

    const-string v4, "_id"

    aput-object v4, v2, v3

    const/4 v3, 0x1

    const-string v4, "thread_id"

    aput-object v4, v2, v3

    const/4 v3, 0x2

    const-string v4, "address"

    aput-object v4, v2, v3

    const/4 v3, 0x3

    const-string v4, "person"

    aput-object v4, v2, v3

    const/4 v3, 0x4

    const-string v4, "date"

    aput-object v4, v2, v3

    const/4 v3, 0x5

    const-string v4, "body"

    aput-object v4, v2, v3

    const/4 v3, 0x6

    const-string v4, "read"

    aput-object v4, v2, v3

    const-string v3, " read=?"

    const/4 v4, 0x1

    new-array v4, v4, [Ljava/lang/String;

    const/4 v5, 0x0

    const-string v6, "0"

    aput-object v6, v4, v5

    const-string v5, "date desc"

    invoke-virtual/range {v0 .. v5}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v7

    .line 56
    .local v7, "cursor":Landroid/database/Cursor;
    const/4 v8, 0x0

    .local v8, "i":I
    :goto_1
    invoke-interface {v7}, Landroid/database/Cursor;->getCount()I

    move-result v1

    if-lt v8, v1, :cond_1

    .line 63
    invoke-interface {v7}, Landroid/database/Cursor;->close()V

    goto :goto_0

    .line 64
    .end local v0    # "contentResolver":Landroid/content/ContentResolver;
    .end local v7    # "cursor":Landroid/database/Cursor;
    .end local v8    # "i":I
    .end local v9    # "smsNumbers":[Ljava/lang/String;
    :catch_0
    move-exception v1

    goto :goto_0

    .line 57
    .restart local v0    # "contentResolver":Landroid/content/ContentResolver;
    .restart local v7    # "cursor":Landroid/database/Cursor;
    .restart local v8    # "i":I
    .restart local v9    # "smsNumbers":[Ljava/lang/String;
    :cond_1
    invoke-interface {v7, v8}, Landroid/database/Cursor;->moveToPosition(I)Z

    .line 58
    iget-object v1, p0, Lrexsee/service/RexseePushSmsListener$1;->this$0:Lrexsee/service/RexseePushSmsListener;

    const/4 v2, 0x2

    invoke-interface {v7, v2}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v2

    # invokes: Lrexsee/service/RexseePushSmsListener;->inSms(Ljava/lang/String;[Ljava/lang/String;)Z
    invoke-static {v1, v2, v9}, Lrexsee/service/RexseePushSmsListener;->access$2(Lrexsee/service/RexseePushSmsListener;Ljava/lang/String;[Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_2

    .line 59
    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "content://sms/conversations/"

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const/4 v2, 0x1

    invoke-interface {v7, v2}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v2

    invoke-virtual {v1, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v1

    const-string v2, " _id=?"

    const/4 v3, 0x1

    new-array v3, v3, [Ljava/lang/String;

    const/4 v4, 0x0

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    const/4 v6, 0x0

    invoke-interface {v7, v6}, Landroid/database/Cursor;->getInt(I)I

    move-result v6

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    aput-object v5, v3, v4

    invoke-virtual {v0, v1, v2, v3}, Landroid/content/ContentResolver;->delete(Landroid/net/Uri;Ljava/lang/String;[Ljava/lang/String;)I

    .line 60
    iget-object v1, p0, Lrexsee/service/RexseePushSmsListener$1;->this$0:Lrexsee/service/RexseePushSmsListener;

    # getter for: Lrexsee/service/RexseePushSmsListener;->smsContext:Landroid/content/Context;
    invoke-static {v1}, Lrexsee/service/RexseePushSmsListener;->access$0(Lrexsee/service/RexseePushSmsListener;)Landroid/content/Context;

    move-result-object v1

    const-string v2, "sms"

    const/4 v3, 0x4

    invoke-interface {v7, v3}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v3

    const/4 v5, 0x2

    invoke-interface {v7, v5}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v5

    const/4 v6, 0x5

    invoke-interface {v7, v6}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v6

    invoke-static/range {v1 .. v6}, Lrexsee/service/RexseePush;->add(Landroid/content/Context;Ljava/lang/String;JLjava/lang/String;Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 56
    :cond_2
    add-int/lit8 v8, v8, 0x1

    goto :goto_1
.end method
